Beginning NFC by Tom Igoe Don Coleman & Brian Jepson
Author:Tom Igoe, Don Coleman & Brian Jepson
Language: eng
Format: epub
ISBN: 9781449372064
Publisher: O’Reilly Media, Inc.
Published: 2014-09-01T04:00:00+00:00
Music User Interface Event Handlers
Now that the lighting user interface elements are taken care of, it’s time to write the event handlers for the music playback. Figure 6-6 shows a detail of those controls.
Figure 6-6. The music controls for the app
The first music event handler to write is the getSongs() handler. This handler is called in the onDeviceReady() handler. It uses PhoneGap’s File API to read the directory listing of the music directory and get a list of all the song names and URIs to populate the music selector in the UI.
This function is heavily dependent on callbacks, so it helps to start reading it from the bottom. It starts by looking for the directory using resolveLocalFileSystemURI(), and when that succeeds, it calls foundDirectory(). That looks for the directory entries, and when it succeeds, it calls foundFiles() to fill the selector in the HTML. There’s a common failure handler for all of these in case they fail: an alert box pops up with the cause of the failure.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(25281)
Hello! Python by Anthony Briggs(24334)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(23419)
Kotlin in Action by Dmitry Jemerov(22503)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(21957)
Dependency Injection in .NET by Mark Seemann(21837)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(20704)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(19517)
Grails in Action by Glen Smith Peter Ledbrook(18594)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(17028)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(15836)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(13683)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(11850)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(11151)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10621)
Hit Refresh by Satya Nadella(9185)
The Kubernetes Operator Framework Book by Michael Dame(8561)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8400)
Robo-Advisor with Python by Aki Ranin(8357)